{{ define "header" }}
<!-- Post Header -->
<style type="text/css">
    header.intro-header{
        background-image: url('{{ if .Params.image }}{{ .Params.image | absURL }}{{ else }}{{ .Site.Params.header_image | absURL}}{{ end }}')
    }
</style>
<header class="intro-header" >
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <div class="post-heading">
                    <div class="tags">
                       {{ range .Params.tags }}
                       <a class="tag" href="{{ "/tags/" | relLangURL }}{{ . | urlize }}" title="{{ . }}">
                           {{ . }}
                        </a>
                        {{ end }}
                    </div>
                    <h1>{{ .Title }}</h1>
                    <h2 class="subheading">{{ .Params.subtitle }}</h2>
                    <span  class="meta">Posted by {{ if .Params.author }}{{ .Params.author }}{{ else }}{{ .Site.Title }}{{ end }} on {{ .Date.Format "Monday, January 2, 2006" }}
                        {{ if .Site.Params.page_view_conter }}
                        <span id="busuanzi_container_page_pv">|<span id="busuanzi_value_page_pv"></span><span>
                            {{ partial "page_view_counter.html" .  }}
                            阅读 </span></span>|<span class="post-date">共{{ .WordCount  }}字</span>，阅读约<span class="more-meta"> {{ .ReadingTime  }} 分钟</span>
                        {{ end }}
                    </span>
                </div>
            </div>
        </div>
    </div>
</header>
{{ end }}

{{ define "main" }}
<!-- Post Content -->
<article>
    <div class="container">
        <div class="row">

            <!-- Post Container -->
            <div class="
                col-lg-8 col-lg-offset-2
                col-md-10 col-md-offset-1
                post-container">

		{{ if eq .Params.showtoc false }}
		{{ else }}
                <header>
                <h2>TOC</h2>
                </header>
                {{.TableOfContents}}
		{{ end }}
		{{ .Content }}

                <hr>

                <ul class="pager">
                    {{ if .Prev }}
                    <li class="previous">
                        <a href="{{ .Prev.URL }}" data-toggle="tooltip" data-placement="top" title="{{ .Prev.Title}}">&larr; Previous Post</a>
                    </li>
                    {{ end }}
                    {{ if .Next }}
                    <li class="next">
                        <a href="{{ .Next.URL }}" data-toggle="tooltip" data-placement="top" title="{{ .Next.Title}}">Next Post &rarr;</a>
                    </li>
                    {{ end }}
                </ul>

            {{ partial "comments.html" . }}

            </div>
            <!-- Sidebar Container -->
            <div class="
                col-lg-8 col-lg-offset-2
                col-md-10 col-md-offset-1
                sidebar-container">

                <!-- Featured Tags -->
                <section>
                    <hr class="hidden-sm hidden-xs">
                    <h5><a href="/tags/">FEATURED TAGS</a></h5>
                    <div class="tags">
                    {{ $featured_condition_size := .Site.Params.featured_condition_size }} 
                    {{ range $name, $taxonomy := .Site.Taxonomies.tags }}
                       {{ if gt (len $taxonomy.Pages) $featured_condition_size }} 
                            <a href="{{ "/tags/" | relLangURL }}{{ $name | urlize }}" title="{{ $name }}">
                                {{ $name }}
                            </a>
                       {{ end }} 
                    {{ end }}
                    </div>
                </section>

                <!-- Friends Blog -->
                <hr>
                <h5>FRIENDS</h5>
                <ul class="list-inline">
                    {{ range .Site.Params.friend_link }}
                        <li><a target="_blank" href="{{.href}}">{{.title}}</a></li>
                    {{ end }}
                </ul>
            </div>
        </div>
    </div>
</article>

{{ end }}


